import Vue from 'vue'
import VueRouter from 'vue-router'
import home from '../views/home'
import friends from '../views/friends'
import cart from '../views/cart'
import search from '../views/search'
import NoFoundPage from '../views/404'
import layout from '../laylout'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: layout,
    redirect: '/home',
    children: [
      {
        path: '/home',
        component: home
      },
      {
        path: '/friends',
        component: friends
      },
      {
        path: '/cart',
        component: cart
      },
      {
        path: '/search',
        component: search
      }
    ]
  },
  {
    path: '*',
    component: NoFoundPage
  }
]

const router = new VueRouter({
  routes
})

export default router
